package com.yuke.cloud.service.api.smc.service;

import com.yuke.cloud.common.security.feign.OAuth2FeignAutoConfiguration;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.api.smc.dto.GoodsAndSpecInfoDto;
import com.yuke.cloud.service.api.smc.dto.ShopCartInfoDto;
import com.yuke.cloud.service.api.smc.dto.ShopGoodsSalePriceDto;
import com.yuke.cloud.service.api.smc.dto.ShopInfoDto;
import com.yuke.cloud.service.api.smc.service.hystrix.SmcFeignApiHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "yuke-cloud-service-smc", configuration = OAuth2FeignAutoConfiguration.class,
        fallback = SmcFeignApiHystrix.class, path = "${yuke.feign-path-smc}")
//@FeignClient(value = "yuke-cloud-service-smc", fallback = SmcFeignApiHystrix.class)
public interface SmcFeignApi {
    @PostMapping("/smc/api/warehouse/book")
    Integer updateStockCount(@RequestParam("json") String json);

    @GetMapping("/smc/api/goodsStatus")
    Byte getGoodsStatus(@RequestParam("shopId") Long shopId, @RequestParam("specId") Long specId);

    @PostMapping("/smc/api/goodsStatus")
    List<GoodsAndSpecInfoDto> getGoodsStatusList(@RequestBody List<GoodsAndSpecInfoDto>  goodsAndSpecInfoDtos);

    @GetMapping("/smc/api/spec")
    Integer getLowPriceBySpecId(@RequestParam("specId") Long specId);

    @PostMapping("/smc/api/shopCart")
    List<ShopCartInfoDto> getShopCartInfoDto(@RequestBody List<GoodsAndSpecInfoDto>  goodsAndSpecInfoDtos);

    @PostMapping("/smc/api/shopInfo")
    List<ShopInfoDto> getShopInfoByShopIds(@RequestBody List<Long> shopIds);

    @PostMapping("/smc/api/shop/userId")
    List<ShopInfoDto> getShopUserIdByShopIds(@RequestBody List<Long> shopIds);

    @GetMapping("/smc/api/shopIds")
    List<Long> getShopIdsShopName(@RequestParam("shopName") String shopName);

    @PostMapping("/smc/api/salePrice")
    Wrapper<List<GoodsAndSpecInfoDto>> getShopGoodsSalePrice(@RequestBody ShopGoodsSalePriceDto shopGoodsSalePriceDto);

    @PostMapping("/smc/api/shop")
    List<ShopInfoDto> getShopAccountByShopIds(@RequestBody List<Long> shopIds);

    @GetMapping("/smc/api/stockCount")
    Integer getShopStockCount(@RequestParam("shopId") Long shopId, @RequestParam("specId") Long specId);

    @GetMapping("/smc/api/getShopByFactoryId")
    Wrapper<ShopInfoDto> getShopByFactoryId(@RequestParam("factoryId") Long factoryId);

    @PostMapping("/smc/api/shopCondition")
    List<ShopInfoDto> getShopIdsByCondition();

    @PostMapping("/smc/api/getShopInfoDtoByUserId")
    List<ShopInfoDto> getShopInfoDtoByUserId(@RequestParam("userId") Long userId);

    @GetMapping("/smc/api/getShopInfoByShopName")
    List<ShopInfoDto> getShopInfoByShopName(@RequestParam("shopName") String shopName);

    @GetMapping("/smc/api/getShopInfoByGroupId")
    List<ShopInfoDto> getShopInfoByGroupId(@RequestParam("groupId") Long groupId);


    @PostMapping("/smc/api/getShopInfoDtoByUserIdList")
    List<ShopInfoDto> getShopInfoDtoByUserIdList(@RequestBody List<Long> userIds);

    @PostMapping("/smc/api/addShop")
    Integer addShop(@RequestBody ShopInfoDto shopInfoDto);

    @PostMapping("/smc/api/saveShop")
    Integer saveShop(@RequestBody ShopInfoDto shopInfoDto);

    @PostMapping("/smc/api/addDmsSend")
    Integer addDmsSend(@RequestParam("userId") Long userId, @RequestParam("orderId") Long orderId,@RequestParam("amountPay") Integer amountPay);

    @PostMapping("/smc/api/getShopInfoByShopId")
    ShopInfoDto getShopInfoByShopId(@RequestParam("shopId") Long shopId);

    @PostMapping("smc/api/getAllShopInfo")
    List<ShopInfoDto> getAllShopInfo();

    @PostMapping("smc/api/updateSendDeleteTag")
    Integer updateSendDeleteTag(@RequestParam("orderId") Long orderId);

    @PostMapping("smc/api/getShopNameByShopIds")
    List<ShopInfoDto> getShopNameByShopIds(@RequestBody List<Long> shopIds);
}
